package com.china08.yxyapi.repository.mg.statistics;

import java.util.List;

import org.springframework.data.mongodb.repository.MongoRepository;

import com.china08.yxyapi.entity.mg.statistics.UserUploadResourceTotal;

import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
public interface UserUploadResourceTotalRepository extends MongoRepository<UserUploadResourceTotal, String> {
    /**
     * 通过上传资源从高到低排序
     * @param schoolId
     * @return
     */
	Page<UserUploadResourceTotal> findBySchoolIdOrderByResCountDesc(String schoolId,Pageable pageable);
	/**
     * 通过上传资源从低到高排序
     * @param schoolId
     * @return
     */
	Page<UserUploadResourceTotal> findBySchoolIdOrderByResCountAsc(String schoolId,Pageable pageable);
	/**
	 * 共享资源从高到低
	 * @param schoolId
	 * @return
	 */
	Page<UserUploadResourceTotal> findBySchoolIdOrderByShareResCountDesc(String schoolId,Pageable pageable);
	/**
	 * 共享资源从低到高
	 * @param schoolId
	 * @return
	 */
	Page<UserUploadResourceTotal> findBySchoolIdOrderByShareResCountAsc(String schoolId,Pageable pageable);
	/**
	 * 上传微课从高到低
	 * @param schoolId
	 * @return
	 */
	Page<UserUploadResourceTotal> findBySchoolIdOrderByWeikeCountDesc(String schoolId,Pageable pageable);
	/**
	 * 上传微课从低到高
	 * @param schoolId
	 * @return
	 */
	Page<UserUploadResourceTotal> findBySchoolIdOrderByWeikeCountAsc(String schoolId,Pageable pageable);
	/**
	 * 共享微课从高到低
	 * @param schoolId
	 * @return
	 */
	Page<UserUploadResourceTotal> findBySchoolIdOrderByShareWeikeCountDesc(String schoolId,Pageable pageable);
	/**
	 * 共享微课从低到高
	 * @param schoolId
	 * @return
	 */
	Page<UserUploadResourceTotal> findBySchoolIdOrderByShareWeikeCountAsc(String schoolId,Pageable pageable);
	/**
	 * 用户名模糊查询
	 * @param schoolId
	 * @param username
	 * @return
	 */
	Page<UserUploadResourceTotal> findBySchoolIdAndUserNickLike(String schoolId, String username,Pageable pageable);
	/**
	 * 上传资源从高到低并且按照用户名模糊查询
	 * @param schoolId
	 * @param username
	 * @return
	 */
	Page<UserUploadResourceTotal> findBySchoolIdAndUserNickLikeOrderByResCountDesc(String schoolId, String username,Pageable pageable);
	/**
	 * 上传资源从低到高并且按照用户名模糊查询
	 * @param schoolId
	 * @param username
	 * @return
	 */
	Page<UserUploadResourceTotal> findBySchoolIdAndUserNickLikeOrderByResCountAsc(String schoolId, String username,Pageable pageable);
	/**
	 * 共享资源从高到低并且按照用户名模糊查询
	 * @param schoolId
	 * @param username
	 * @return
	 */
	Page<UserUploadResourceTotal> findBySchoolIdAndUserNickLikeOrderByShareResCountDesc(String schoolId,
			String username,Pageable pageable);
	/**
	 * 共享资源从低到高并且按照用户名模糊查询
	 * @param schoolId
	 * @param username
	 * @return
	 */
	Page<UserUploadResourceTotal> findBySchoolIdAndUserNickLikeOrderByShareResCountAsc(String schoolId,
			String username,Pageable pageable);
	/**
	 * 上传微课从高到低并且按照用户名模糊查询
	 * @param schoolId
	 * @param username
	 * @return
	 */
	Page<UserUploadResourceTotal> findBySchoolIdAndUserNickLikeOrderByWeikeCountDesc(String schoolId, String username,Pageable pageable);
	/**
	 * 上传微课从低到高并且按照用户名模糊查询
	 * @param schoolId
	 * @param username
	 * @return
	 */
	Page<UserUploadResourceTotal> findBySchoolIdAndUserNickLikeOrderByWeikeCountAsc(String schoolId, String username,Pageable pageable);
	/**
	 * 共享微课从高到低并且按照用户名模糊查询
	 * @param schoolId
	 * @param username
	 * @return
	 */
	Page<UserUploadResourceTotal> findBySchoolIdAndUserNickLikeOrderByShareWeikeCountDesc(String schoolId,
			String username,Pageable pageable);
	/**
	 * 共享微课从低到高并且按照用户名模糊查询
	 * @param schoolId
	 * @param username
	 * @return
	 */
	Page<UserUploadResourceTotal> findBySchoolIdAndUserNickLikeOrderByShareWeikeCountAsc(String schoolId,
			String username,Pageable pageable);
	/**
	 * 通过学校id查询记录
	 * @param schoolId
	 * @return
	 */
	Page<UserUploadResourceTotal> findBySchoolId(String schoolId,Pageable pageable);
	
	/**
	 * 通过用户id查询相关记录
	 * @param userId
	 * @return
	 */
	UserUploadResourceTotal findByUserId(String userId);
    
}
